a783a6e6cb83a25300802fbdd8c79a40ea1c4feb,src/main/java/com/continuuity/passport/dal/db/AccountDBAccess.java,AccountDBAccess,updateBillingInfo,#number#BillingInfo#,174
Before Change
try {
Connection connection = this.poolManager.getConnection();
SQLChain chain = SQLChainImpl.getSqlChain(connection);
chain.insert(DBUtils.AccountPayment.TABLE_NAME)
.columns(DBUtils.AccountPayment.ACCOUNT_ID_COLUMN, DBUtils.AccountPayment.CREDIT_CARD_NAME_COLUMN,
DBUtils.AccountPayment.CREDIT_CARD_NUMBER_COLUMN, DBUtils.AccountPayment.CREDIT_CARD_CVV_COLUMN,
DBUtils.AccountPayment.CREDIT_CARD_EXPIRY_COLUMN)
.values(accountId,billingInfo.getCreditCardName(),billingInfo.getCreditCardNumber(),
billingInfo.getCvv(),billingInfo.getExpirationDate())
.execute();
}
catch (SQLException e){
throw new RuntimeException(e.getMessage(),e.getCause());
After Change
@Override
public boolean updateBillingInfo(int accountId, BillingInfo billingInfo) throws ConfigurationException,RuntimeException {
if(this.poolManager == null){
throw new ConfigurationException("DBConnection pool is null. DAO is not configured");
}
try {
Connection connection = this.poolManager.getConnection();
String SQL = String.format( "INSERT INTO %s (%s,%s,%s,%s,%s) VALUES(?,?,?,?,?)" ,
DBUtils.AccountPayment.TABLE_NAME,
DBUtils.AccountPayment.ACCOUNT_ID_COLUMN,
DBUtils.AccountPayment.CREDIT_CARD_NAME_COLUMN,
DBUtils.AccountPayment.CREDIT_CARD_NUMBER_COLUMN,
DBUtils.AccountPayment.CREDIT_CARD_CVV_COLUMN,
DBUtils.AccountPayment.CREDIT_CARD_EXPIRY_COLUMN);
PreparedStatement ps = connection.prepareStatement(SQL);
ps.setInt(1,accountId);
ps.setString(2, billingInfo.getCreditCardName());
ps.setString(3, billingInfo.getCreditCardNumber());
ps.setString(4,billingInfo.getCvv());
ps.setString(5,billingInfo.getExpirationDate());
ps.executeUpdate();
}
catch (SQLException e){